PtInRgn
PtInRgn Check if a specified pixel is enclosed by a region
#include <Quickdraw.h> Quickdraw
Boolean PtInRgn(thePt, theRgn );
Point thePt ; point identifying the pixel in question
RgnHandle theRgn ; handle of a region
returns Is thePt inside of theRgn ?
PtInRgn returns an indication of whether or not a point (actually, the pixel
below and to the right of a mathematical coordinate) is enclosed by the outline
of a region.
thePt is a Point, expressed in local or global coordinates.
theRgn is the handle of a region, in the same coordinate system as thePt.
Returns: a Boolean value indicating whether the point is inside of the region.
It is one of:
FALSE Not in the region
TRUE In the region

Notes: This is useful in determining if a mouse-down event has occurred while
the cursor was positioned in the area of a region. Note that since the
EventRecord.where field is expressed in global coordinates, so you may
need to convert as follows:
GetNextEvent( everyEvent, &theEvent );
.
:
GlobalToLocal( & theEvent.where );
if (PtInRgn( theEvent.where, theRgn ) {
... /* yes, it was in that region */ ...
}